import Vue from "vue";
import Vuex from "vuex";
import product from "./modules/product";
import login from "./modules/login";
import menu from "./modules/menu";
import CreatePersistedstate from "vuex-persistedstate";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    isCollapse: false,
  },
  mutations: {
    changeIsCollapse(state, bool) {
      state.isCollapse = bool;
    },
  },
  getters: {},
  actions: {},
  modules: {
    product,
    login,
    menu,
  },
  plugins: [
    CreatePersistedstate({
      key: "info",
      paths: ["product",'login'],
    }),
  ],
});
